﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XEvents.Library.Targets
{
    public class FiredEvent
    {
        #region Private Members
        internal string name;
        internal string package;
        internal string id;
        internal string version;
        internal string timestamp;

        internal EventPayloadItemCollection payloaddata;
        #endregion

        public string Name
        {
            get { return name; }
            set { }
        }

        public string Package
        {
            get { return package; }
            set { }
        }

        public string Id
        {
            get { return id; }
            set { }
        }

        public string Version
        {
            get { return version; }
            set { }
        }

        public string Timestamp
        {
            get { return timestamp; }
            set { }
        }

        public EventPayloadItemCollection EventPayloadItemCollection
        {
            get { return payloaddata; }
            set { }
        }


        public FiredEvent()
        {
        }
        /*
        <RingBufferTarget eventsPerSec="0" processingTime="0" totalEventsProcessed="2" eventCount="2" droppedCount="0" memoryUsed="2148">
          <event name="error_reported" package="sqlserver" id="100" version="1" timestamp="2008-12-26T01:15:58.665Z">
            <data name="error">
              <type name="int32" package="package0" />
              <value>17830</value>
              <text />
            </data>
            <data name="severity">
              <type name="int32" package="package0" />
              <value>20</value>
              <text />
            </data>
            <data name="state">
              <type name="int32" package="package0" />
              <value>11</value>
              <text />
            </data>
            <data name="user_defined">
              <type name="boolean" package="package0" />
              <value>false</value>
              <text />
            </data>
            <data name="message">
              <type name="unicode_string" package="package0" />
              <value>Network error code 0x2746 occurred while establishing a connection; the connection has been closed. This may have been caused by client or server login timeout expiration. Time spent during login: total 24 ms, enqueued 1 ms, network writes 0 ms, network reads 22 ms, establishing SSL 23 ms, negotiating SSPI 0 ms, validating login 0 ms, including user-defined login processing 0 ms. [CLIENT: 10.254.40.79]</value>
              <text />
            </data>
            <action name="callstack" package="package0">
              <type name="callstack" package="package0" />
              <value>0x01761EDD
        0x013398B7
        0x01339D57
        0x026A19E6
        0x01ED23C4
        0x0153AEE9
        0x01539F15
        0x015927EE
        0x01592919
        0x015925EE
        0x0111372E
        0x01113631
        0x0156077B
        0x0111318A
        0x781329BB
        0x78132A47</value>
              <text />
            </action>
            <action name="session_id" package="sqlserver">
              <type name="uint16" package="package0" />
              <value>0</value>
              <text />
            </action>
            <action name="sql_text" package="sqlserver">
              <type name="unicode_string" package="package0" />
              <value>Unable to retrieve SQL text</value>
              <text />
            </action>
            <action name="tsql_stack" package="sqlserver">
              <type name="unicode_string" package="package0" />
              <value>Unable to retrieve T-SQL stack</value>
              <text />
            </action>
          </event>
        </RingBufferTarget>
        */
    }
}
